import request from '@/utils/request'
import { makeRequestJson } from '@/utils/common'
import * as crud from '@/api/crud'

export function list(query, responseType) {
  for (const key in query) {
    if (query[key] === '') {
      query[key] = undefined
    }
  }
  return request(makeRequestJson('post', '/user/index ', query, responseType))
}

export function get(data) {
  return crud.get({ method: 'post', url: '/user/getInfo', data: data })
}

// export function create(data) {
//   return crud.create({ method: 'post', url: '/user/create', data: data })
// }

export function update(data) {
  return crud.update({ method: 'post', url: '/user/update', data: data })
}

export function relation(data) {
  return request(makeRequestJson('post', '/user/relation', data))
}

export function recharge(data) {
  return request(makeRequestJson('post', '/user/recharge', data))
}

